package com.zephyr.vchcenter.dwrAction;

import com.zephyr.vchcenter.helper.SpringHelper;
import com.zephyr.vchcenter.service.IIdentifyService;

/**
 * 与ocx控件进行交互操作的action
 * 
 * @author zhuolongqi
 */
public class ActiveXDwrAction {

	// 获取验印交易报文
	public String getIdTradeXML(String vchsid, String vchdate, String amount,
			int sceneflag) {
		System.out.println("vchsid: " + vchsid);
		IIdentifyService iis = (IIdentifyService) SpringHelper
				.getBean("identifyService");
		String identifyXML = iis.getIdentifyXML(vchsid, "127.0.0.1", vchdate,
				amount, sceneflag);
		System.out.println("identifyXML: " + identifyXML.substring(0, 100));
		return identifyXML;
	}

	// 存储验印结果
	public String saveIdResult(int commandid, String xml, String vchsid) {
		IIdentifyService iis = (IIdentifyService) SpringHelper
				.getBean("identifyService");
		String result = iis.decodeResultXML(commandid, xml, vchsid);
		return result;

	}
}
